#include "service_arch/service_arch.h"
#include "service_arch/service_base_impl.h"
#include "database/simple_db_pool.h"
#include "base/logging.h"

#include "ArticleMain_types.h"
#include "ArticleMain_constants.h"
#include "ArticleMain.h"

#include <iostream>
#include <map>
#include <boost/detail/atomic_count.hpp>

#include <thrift/concurrency/Mutex.h>
#include <thrift/concurrency/TimerManager.h>

#include "article_main/article_redis_adapter.h"

using namespace std;
using namespace apache::thrift;

namespace jztzp {

class ArticleMainHandler : public ArticleMainIf, public ServiceBaseImpl {
 public:
  ArticleMainHandler() : db_pool_("xingtan", "127.0.0.1:3306", "root", "") {
  }

  virtual ~ArticleMainHandler() {}

  virtual void Get(ArticleResult& _return, const int32_t id) {
  }
  virtual void GetMeta(ArticleResult& _return, const int32_t id) {
  }
  virtual void GetContent(ArticleResult& _return, const int32_t id);
  virtual int32_t UpdateContent(int32_t, const std::string&);
 private:
  base::SimpleConnectionPool db_pool_; 
  ArticleRedisAdapter redis_adapter_;
};

}

